SaveData["episode"] = SaveData["episode"] or {}


function onTick()
	for key, value in ipairs(NPC.get(97, -1)) do
		if not value.StoredY then
			value.StoredY = value.y
		end
		value.y = value.StoredY
	end
	for key, value in ipairs(NPC.get(196, -1)) do
		if not value.StoredY then
			value.StoredY = value.y
		end
		value.y = value.StoredY
	end
	if Level.winState() == 6 then
		Level.winState(1)
	end
end

-- When Star is collected, activate the elevator.
function onNPCKill(eventObj, npcObj, npcKillReason) if npcObj.id == 196 and npcKillReason == 9 then 
	--globalsave.FixElevator = true
	--Text.showMessageBox("Elevator has been fixed!")
	end
end